/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.nanosn.coffeemaker;

import java.util.logging.Level;
import java.util.logging.LogRecord;
import java.util.logging.SimpleFormatter;

/**
 * Formats log messages to NanoSN Standards
 * @author selkhateeb
 */
public class LogFormatter extends SimpleFormatter
{
    /**
     * Formats the log messages.
     * Pre:
     * Post: the log message has been formatted.
     * @param record
     * @return a String containing the formatted message.
     */
    @Override
    public String format(LogRecord record)
    {
        StringBuffer stringBuffer = new StringBuffer(1000);

        if (record.getLevel().equals(Level.INFO))
        {
            stringBuffer.append(record.getMessage());
            stringBuffer.append("\n");
        } else
        {
            stringBuffer.append(super.format(record));

        }
        return stringBuffer.toString();

    }
}
